package com.hiwhitley.easy.day08;

import java.util.AbstractCollection;

/**
 * Created by hiwhitley on 2016/8/12.
 */
public class TitleNumber {
    public static int titleToNumber(String s) {
        int value = 0;
        for(int i = 0; i < s.length(); i++)
            value = value * 26 + ((int)s.charAt(i) - 'A') + 1;
        return value;
    }

    public static void main(String[] args) {
        System.out.println(titleToNumber("BA"));
    }
}
